package com.iris.live.services.data.repositories;

import com.iris.live.services.data.models.Lsh保险战败原因附属Model;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by HangLiu on 2016/11/9.
 */
public interface Lsh保险战败原因附属Repository extends JpaRepository<Lsh保险战败原因附属Model, Integer>, JpaSpecificationExecutor< Lsh保险战败原因附属Model > {
    @Modifying
    @Query("delete   from Lsh保险战败原因附属Model u where u.保险战败原因编号=?1 and u.战败分类=?2")
    int deleteByIDclassify(Integer id,String classification );

    @Query("select u  from Lsh保险战败原因附属Model u where u.保险战败原因编号=?1 and u.战败分类=?2")
    List<Lsh保险战败原因附属Model> findByIDclassify(Integer id, String classification);
}
